import django_filters

from books.models import Books


class BookFilter(django_filters.FilterSet):
    type = django_filters.CharFilter(field_name='type', lookup_expr='icontains' )
    name = django_filters.CharFilter(field_name='name', lookup_expr='icontains')
    house = django_filters.CharFilter(field_name='house', lookup_expr='icontains')
    auther = django_filters.CharFilter(field_name='auther', lookup_expr='icontains')
    class Meta:
        model = Books
        fields = ['type', 'name', 'house', 'auther']